#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>

int main(int argc, char **argv)
{
	int fd;
	unsigned int val = 0;
	
	fd = open("/dev/key", O_RDWR);
	if(fd < 0)
	{
		printf("can`t open!\n");
		return -1;
	}
				
	while (1)
	{
		read(fd, &val, 1);
		printf("key down!get val = %d\n", val);	
	}    
	return 0;
}
